import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:"/index/Home"
  },
  {
    path: '/index',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../Laout/index'),
    children:[
      {
        path:"Home",
        component: () => import(/* webpackChunkName: "about" */ '../views/Home.vue'),
      },
      {
        path:"search",
        component: () => import(/* webpackChunkName: "about" */ '../views/search.vue'),
      },
      {
        path:"mine",
        component: () => import(/* webpackChunkName: "about" */ '../views/mine'),
      },

    ]
  },
  {
    path:"/detailr/:id",
    name:"detailr",
    component: () => import('../components/detailr'),
  },
  {
    path:"/listdetailr",
    name:"listdetailr",
    component: () => import('../views/listdetailr'),
    children: [
      {
        path:"lyric",
        component: () => import('../components/lyric'),
      }
    ]
  },
  {
    path:"/rankings",
    name:"rankings",
    component: () => import('../components/rankings'),
  }

  // {
  //   path:"/lyric",
  //   component: () => import('../components/lyric'),
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,


})

export default router
